package com.example.demo.controller;

import com.example.demo.service.ProblemService;
import com.example.demo.service.UserService;
import com.example.demo.vo.Result;
import com.example.demo.vo.params.SearchParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SearchController {
    @Autowired
    private ProblemService problemService;

    @Autowired
    private UserService userService;

    @PostMapping("/search")
    public Result search(@RequestBody SearchParams params){
        return problemService.selectByLike(params);
    }

    @PostMapping("/userSearch")
    public Result userSearch(@RequestBody SearchParams params){
        return userService.userSearch(params);
    }


}

